home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / nt.case.symbolic.txt < prev    next >
Encoding:
Internet Message Format  |  1999-03-24  |  8.6 KB

  1. Date: Fri, 12 Mar 1999 13:03:57 -0700
  2. From: Mark <mark@NTSHOP.NET>
  3. To: NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM
  4. Subject: [ ALERT ] Case Sensitivity and Symbolic Links
  5.  
  6. Prasad Dabak of Cybermedia Software Private Limited has discovered yet
  7. another security risk in Windows NT involving the operating system's case
  8. sensitivity. According to the report, using the permissions on the "\??"
  9. object directory and by exploiting the case sensitivity of object manager,
  10. it is possible to trojan any system executables.
  11.  
  12. Any ordinary user has write permissions on \?? Object directory. This is to
  13. allow user to map network drives or use "subst" utility to alias a directory
  14. to a new drive letter. Each system drive has an entry into \?? object
  15. directory. Each entry is actually a symbolic link which points to the device
  16. associated with that drive (ergo: Symbolic link \??\C: will typically point
  17. to a device such as \Device\HardDisk0\Partition1). It is possible to create
  18. a trojaned version of this symbolic link using the different character
  19. case -- for example, it is possible to create a symbolic link such as \??\c:
  20. (notice the small letter "c".) By doing this, all the requests to drive C
  21. get routed through the trojaned symbolic link.
  22.  
  23. Please visit the following URL, where you'll find the further details along
  24. with links to a demonstration of the problem.
  25. http://www.ntsecurity.net/scripts/load.asp?iD=/security/casesensitive.htm
  26.  
  27. Mark
  28.  
  29. ----------------------------------------------------------------------------
  30.  
  31. Date: Sat, 13 Mar 1999 00:32:19 +0100
  32. From: Alexandre Stervinou <stervino@INFO.ENSERB.U-BORDEAUX.FR>
  33. To: BUGTRAQ@netspace.org
  34. Subject: New Security Vulnerability in WinNT
  35.  
  36. A new security vulnerability in Windows NT4 has been released, I was
  37. just surfin' on http://www.cybermedia.co.in/, when I saw this:
  38.  
  39. <quote>
  40.  
  41.  CSPL has uncovered most serious Case Sensitivity vulnerability in
  42. Microsoft's Windows NT operating  system. This security hole allows you
  43. to get "Administrator" access on a machine while logged in as "guest" or
  44. any ordinary user
  45.  
  46. [...]
  47.  
  48. Description:
  49.  Using the permissions on the "\??" object directory and by exploiting
  50. the case sensitivity of object manager it is possible to trojan any
  51. system executables.
  52.  
  53. </quote>
  54.  
  55. --
  56.                  Alexandre Stervinou
  57.        mailto:stervino@info.enserb.u-bordeaux.fr
  58.  
  59. ----------------------------------------------------------------------------
  60.  
  61. http://www.cybermedia.co.in/
  62.  
  63. Case Sensitivity vulnerability:
  64.  
  65.  Description: 
  66.  Using the permissions on the "\??" object directory and by exploiting the 
  67.  case sensitivity of object manager it is possible to trojan any system 
  68.  executables. 
  69.          
  70.  Problem: 
  71.  Any ordinary user has write permissions on \?? Object directory. This is to 
  72.  allow user to map network drives or use "subst" utility to alias a directory 
  73.  to a new drive letter. Each drive on the system (let it be local/network/substed) 
  74.  has an entry into \?? object directory. Each entry is actually a symbolic link
  75.  which points to the device associated with that drive. (e.g Symbolic link \??\C: 
  76.  will typically point to a device such as \Device\HardDisk0\Partition1). It is 
  77.  possible to create a trojaned version of this symbolic link using the different 
  78.  case. e.g it is possible to create a symbolic link such as \??\c: (notice the
  79.  small letter æcÆ). By doing this, all the requests to drive C gets routed through 
  80.  the trojaned symbolic link. (e.g If you get the contents of symbolic link \??\D: 
  81.  and create a symbolic link say \??\c: and put those contents there, then 
  82.  executing dir command on drive C will give you directory listing for drive D). 
  83.  So effectively you can route the traffic on drive C to drive D. This is exactly 
  84.  what the simulation program exploits. 
  85.          
  86.  Simulation: 
  87.  The description of simulation assumes that you have unzipped the files from the 
  88.  demo in a directory called C:\FOO and your Windows NT System directory is 
  89.  C:\WINNT\SYSTEM32. 
  90.  
  91.  The simulation works on latest service packs of all Windows NT versions (3.51, 4.0, 5.0)
  92.  
  93.  When you execute BESYSADM.EXE. The program follows the following steps. 
  94.  
  95.        Create an indentical directory structure of Windows system directory under 
  96.             the directory C:\FOO. i.e it will create a directory structure such as
  97.        C:\FOO\WINNT\SYSTEM32 
  98.        Copy all the POSIX subsystem binaries and required DLLs (except PSXSS.EXE) 
  99.             from C:\WINNT\SYSTEM32 directory to
  100.        C:\FOO\WINNT\SYSTEM32 
  101.        Copy the trojaned version of PSXSS.EXE and a dummy posix application 
  102.             DUMMYAPP.EXE from C:\FOO to C:\FOO\WINNT\SYSTEM32 
  103.        Get the contents of the symbolic link \??\C: and append \FOO to it. i.e if 
  104.             the contents of symbolic link \??\C: is \Device\HardDisk0\Partition1
  105.             then new name formed will be \Device\HardDisk0\Partition1\FOO 
  106.        Create a symbolic link \??\c: (note small c) with the contents as 
  107.             \Device\HardDisk0\Partition1\FOO 
  108.        Hence effectively executing a dir command on drive C will now give 
  109.             directory listing of C:\FOO 
  110.        Next the program starts a posix application DUMMYAPP.EXE as "POSIX /c DUMMYAPP.EXE" 
  111.        This results in SMSS.EXE starting POSIX subsystem which effectively loads 
  112.             trojaned version of PSXSS.EXE. 
  113.        This trojaned version inherits security context of SMSS.EXE and hence our 
  114.             PSXSS.EXE runs in root privilege. 
  115.        This trojaned version adds the logged in user to the local administrator group. T 
  116.        The name of the logged in user is passed through a file called u.ini that 
  117.             is created in C:\FOO\WINNT directory. 
  118.  
  119.  Comments 
  120.  The program actually uses \DosDevices everywhere instead of \??, since Windows NT 3.51 
  121.  does not have \?? object directoy and has DosDevices object directory. Starting from 
  122.  Windows NT 4.0, \DosDevices is actually a symbolic link which points to \??. Hence using 
  123.  DosDevices allows the program to run on all Windows NT versions. 
  124.  
  125.  Instructions for Demo
  126.  
  127.        Fresh boot the machine. 
  128.        Login as any ordinary user (guest will also do) 
  129.        Unzip the files in attached .ZIP file in some directory on any local hard drive 
  130.             on your machine 
  131.        Run BESYSADM.EXE 
  132.  
  133.  Note: 
  134.  If you are using Non-English version of Windows NT OR name of the local administrator 
  135.  group is renamed, then specify the name of the local administrator group as a command 
  136.  line to BESYSADM.EXE. If no arguments are specified the program assumes that you are 
  137.  runnning on English version and the name of the local administrator group is "Administrators". 
  138.  
  139. ----------------------------------------------------------------------------
  140.  
  141. Date: Sat, 13 Mar 1999 01:07:18 -0800
  142. From: Dominique Brezinski <dom_brezinski@SECURECOMPUTING.COM>
  143. To: NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM
  144. Subject: Re: [ ALERT ] Case Sensitivity and Symbolic Links
  145.  
  146. At 01:03 PM 3/12/99 -0700, Mark wrote:
  147. >Any ordinary user has write permissions on \?? Object directory. This is to
  148. >allow user to map network drives or use "subst" utility to alias a directory
  149. >to a new drive letter. Each system drive has an entry into \?? object
  150. >directory. Each entry is actually a symbolic link which points to the device
  151. >associated with that drive (ergo: Symbolic link \??\C: will typically point
  152. >to a device such as \Device\HardDisk0\Partition1). It is possible to create
  153. >a trojaned version of this symbolic link using the different character
  154. >case -- for example, it is possible to create a symbolic link such as \??\c:
  155. >(notice the small letter "c".) By doing this, all the requests to drive C
  156. >get routed through the trojaned symbolic link.
  157.  
  158. Well, the exploit does not work on my machine--it fails with "Internal
  159. error..." when run in my test configuration.  I am running NT 4.0
  160. Workstation, SP4, ProtectionMode set to 1, file and registry permissions
  161. set to those recommended in Steve Sutton's NSA guide, Guest user enabled
  162. and allowed to log on locally, %SystemRoot% is on the C partition, and the
  163. exploit executables on the D partition (the only place writable by guest on
  164. my system).  I enabled auditing on the \?? object and no access was
  165. attempted.  So, it appears that something about my configuration stopped
  166. the exploit in its tracks ;)  When I run it from an admin account, it
  167. returns a message saying that the account is already a member of the
  168. administrators group.  Oh yeah, I had to enable the Posix subsystem too.
  169.  
  170. As with the KnownDLLs exploit, good system administration should impede
  171. these kinds of exploits.  Though, they are doing a good job of scratching
  172. the surface of huge classes of local privilege escalation attacks for NT.
  173.  
  174. Dominique Brezinski CISSP                   (206) 898-8254
  175. Secure Computing        http://www.securecomputing.com
  176.  
  177.  
  178.